package com.itheima.service.impl;

import com.github.pagehelper.PageHelper;
import com.itheima.dao.ISysLogDao;
import com.itheima.domain.SysLog;
import com.itheima.service.ISysLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysLogServiceImpl implements ISysLogService {

    @Autowired
    private ISysLogDao sysLogDao;

    /**
     * 添加日志信息到数据库
     *
     * @param sysLog
     */
    @Override
    public void insertSysLog(SysLog sysLog) {
        sysLogDao.insertSysLog(sysLog);
    }

    /**
     * 查询所有日志信息
     *
     * @return
     */
    public List<SysLog> findAllSysLog(Integer pageNum,Integer pageSize) {
        //调用分页插件
        PageHelper.startPage(pageNum,pageSize);
        return sysLogDao.findAllSysLog();
    }
}
